<template>
	<div class="mask">
		<div class="TMB-warp">
			<div class="titler border-bottom">
				<span class="font-w fs16">{{ $t("message.bhView.topBtnDownList.ballSwitch") }}</span>
				<i class="el-icon-close" @click="CloseTables"></i>
			</div>
			<div class="titler">
				<span class="fs16">表示対象</span>
			</div>
			<div class="middle-box">
				<el-radio v-for="(i, v) in objList" :key="i.key" v-model="info" :label="i.key">
					{{ i.label }}
				</el-radio>
			</div>
			<!-- <div class="titler">
				<span class="fs16">表示順</span>
			</div>
			<div class="middle-box">
				<el-radio v-for="(i, v) in arr.ordrList" :key="v" v-model="info[1]" :label="i.key">
					{{ i.label }}
				</el-radio>
			</div> -->
			<div class="footer border-top">
				<span class="font-w">上記の内容で良いですか?</span>
				<div>
					<el-button @click="CloseTables">Cancel</el-button>
					<el-button type="primary" @click="UpdWindcraftSwitchApi">OK</el-button>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import { GetWindcraftSwitch, UpdWindcraftSwitch, enterPointDisplayScreen } from '@/api/api'
import eventBus from "@/eventBus/bus";
import { getLocalStorage } from "@/utils/storage";

export default {
	name: "D_A",
	props: {

	},
	data() {
		return {
			objList: [{
				key: "0",
				label: '定点番号'
			}, {
				key: "1",
				label: 'グループ番号'
			}],
			arr: [],
			info: '0'
		};
	},
	components: {},
	watch: {},
	methods: {
		async GetWindcraftSwitchApi() {
			let dataJson = {
				Account: getLocalStorage("userName"),
			}
			let res = await GetWindcraftSwitch(dataJson);
			if (res.data.code != 0) {
				this.$message({
					type: 'error',
					message: res.data.msg
				})
			}
			this.info = res.data.data;
		},
		async UpdWindcraftSwitchApi() {
			let dataJson = {
				Account: getLocalStorage("userName"),
				Type: Number(this.info)
			}
			let res = await UpdWindcraftSwitch(dataJson);
			if (res.data.code != 0) {
				this.$message({
					type: 'error',
					message: res.data.msg
				})
			}
			this.$message({
				type: 'success',
				message: res.data.msg
			})
			eventBus.$emit('LoadTabelData');
			this.CloseTables();
		},
	

		CloseTables() {
			this.$emit('CloseTabelDialog')
		},
	},
	created() { },
	mounted() {
		this.GetWindcraftSwitchApi();
	},
	beforeDestroy() { },
	destroyed() { }
};
</script>
<style lang="scss" scoped>
.mask {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background-color: rgba(0, 0, 0, 0.25);
	z-index: 99;
}

.TMB-warp {
	width: 600px;
	height: 205px;
	background: rgb(255, 255, 255);
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translateX(-50%) translateY(-50%);
	box-shadow: 0px 12px 48px 16px rgba(0, 0, 0, 0.05),
		0px 9px 28px 0px rgba(0, 0, 0, 0.08), 0px 6px 16px -8px rgba(0, 0, 0, 0.15);
	z-index: 100;
}

.titler {
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 24px;

	i {
		cursor: pointer;
	}
}

.middle-box {
	height: 50px;
	display: flex;
	// flex-direction: column;
	// justify-content: space-around;
	padding: 10px 50px;

	.left-box {
		width: 281px;
		padding: 0 24px;
	}

	.right-box {
		width: calc(100% - 281px);
		padding: 0 24px;
	}

	.row {
		padding: 10px 0;
		display: flex;
		align-items: center;

		.el-input {
			width: 70px;
			height: 32px;

			::v-deep .el-input__inner {
				width: 70px;
				height: 100%;
				text-align: center;
			}
		}

		::v-deep .el-radio__label {
			font-weight: bold;

		}

		.ipt {
			width: 120px !important;
			height: 32px;
			margin-right: 8px;

			::v-deep .el-input__inner {
				width: 100%;
				height: 32px;
				padding: 0 8px 0 30px;
			}

			// ::v-deep .el-input__inner:focus {
			//   border: 1px solid #dcdfe6;
			// }
			::v-deep .el-input__icon {
				line-height: 32px;
				color: #909399;
			}

			::v-deep .el-input__suffix {
				display: none;
			}
		}
	}
}

.footer {
	height: 50px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 13px 24px;

	button {
		width: 82px !important;
		height: 32px;
		// background: #ffffff;
		// border: 1px solid #d9d9d9;
		// cursor: pointer;
	}

	button:nth-child(2) {
		margin-left: 16px;
		// color: #ffffff;
		// background: #106ebe;
	}
}

.font-w {
	font-weight: bold;
}

.border-top {
	border-top: 1px solid #f0f0f0;
}

.border-bottom {
	border-bottom: 1px solid #f0f0f0;
}

.border-left {
	border-left: 1px solid #f0f0f0;
}

.border-right {
	border-right: 1px solid #f0f0f0;
}

.gray {
	color: #7B7B7B;
}

.mar8 {
	margin-right: 8px;
}

.fs16 {
	font-size: 16px;
}
</style>
